import { defHttp } from '/@/utils/http/axios';
import { ApiCommon } from '../common';

const { CUSTOMER_ADMIN_API, ADMIN_USER_DICT_API, MESSAGE_ADMIN_API } = ApiCommon;

enum API {
  HANDLING_PAGE = '/integrated-business/approval/getApprovalBusinessHandlingPage',
  DICT_TYPE = '/params/ApprovalBusinessType', //业务类型
  DICT_STATE = '/params/ApprovalBusinessStatus',
  BUSINESS_INFO = '/integrated-business/approval/getApprovalBusinessHandlingInfo', //业务详情
  GET_SPECIAL = '/integrated-business/approval/getSpecialTreatmentInfo',
  GET_MESSAGE = '/system-sms/user-record/page', // 消息记录列表
  RESEND = '/system-sms/user-record/send-again', // 消息记录再次发送短信
  STAGING_BUSINESS_RECORD = '/integrated-business/approval/getAllApprovalBusinessHandlingPage',
}

// 业务记录
export const gethandlingPage = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + API.HANDLING_PAGE, data });
// 工作台新增业务记录
export const getStagingBusinessRecord = (data: object) =>
  defHttp.post({ url: CUSTOMER_ADMIN_API + API.STAGING_BUSINESS_RECORD, data });

export const getDictType = () => defHttp.get({ url: ADMIN_USER_DICT_API + API.DICT_TYPE });

export const getDictState = () => defHttp.get({ url: ADMIN_USER_DICT_API + API.DICT_STATE });

export const getMessageApi = (data: any) =>
  defHttp.post({ url: MESSAGE_ADMIN_API + API.GET_MESSAGE, data });

export const resendMessageApi = (data: any) =>
  defHttp.post({ url: MESSAGE_ADMIN_API + API.RESEND + '/' + data });

// 业务详情
export const getBusinessDetail = (params: object) =>
  defHttp.get({
    url: CUSTOMER_ADMIN_API + API.BUSINESS_INFO,
    params,
  });

// 账单详情
export const getSpecialTreatmentInfo = (params: object) =>
  defHttp.get({
    url: CUSTOMER_ADMIN_API + API.GET_SPECIAL,
    params,
  });
